<?php
class FuncController extends BaseController
{

	public function actionIndex(){
		$this->power = obj('Func')->power();//TODO:后期转为js 减少服务端的压力
		// $this->items = obj('Define')->get_items();//TODO:检验是否存在item
		$item = $_GET['item'];
		$this->item = $item;
		$time = time();
		$this->funcs = obj('Func')->select("item_name='$item' and flag=1 and cr_time<$time",'func_name','id DESC', 1000);
		if($this->power) {
			$this->hide_funcs = obj('Func')->select("item_name='$item' and (flag!=1 or cr_time>$time)",'func_name','id DESC', 300);
		}
		$this->display('func_index_item.tpl');
	}
	
	public function action_detail(){
		$this->item = $_GET['item'];
		$this->func = $_GET['func'];
		$this->lang = $this->_key(4);
		$this->content = obj('Func')->find(array('item_name'=>$this->item,'func_name'=>$this->func));
		$this->display('func_detail.tpl');
	}
	
	
	
}